#include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using LL=long long;
unordered_map<int,unordered_set<int>> has;
int check(int x,int y){
	
	int sum=1;
	if(has.count(x+1) && has[x+1].count(y)){
		++sum;
	}
	if(has.count(x+1) && has[x+1].count(y+1)){
		++sum;
	}
	if(has.count(x) && has[x].count(y+1)){
		++sum;
	}
	if(has.count(x-1) && has[x-1].count(y+1)){
		++sum;
	}
	if(has.count(x-1) && has[x-1].count(y)){
		++sum;
	}		
	if(has.count(x-1) && has[x-1].count(y-1)){
		++sum;
	}
	if(has.count(x) && has[x].count(y-1)){
		++sum;
	}	
	if(has.count(x+1) && has[x-1].count(y-1)){
		++sum;
	}	
	return sum;	
}
int main(){
	
	int n;
	cin>>n;
	
	LL sum=0;
	for(int i=0;i<n;++i){
		int x,y;
		cin>>x>>y;
		LL t=check(x,y);
		sum-=t;
		sum+=t*t;
		has[x].insert(y);
		sum+=1;
		cout<<sum<<endl;
	}
	
	return 0;
}
